 
  {layout name="common/layout" /}
  <style>
  .box-btn{
	display: inline-block;
	margin:0 20px;
  }
  .box-btn>a{
	  color: #fff;
  }
  .btn-outerbox{
	text-align: center;
	margin-top: 50px;
  }
  .box p{
	  margin-top: 20px;
  }
  </style>
	<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a></div>
<div class="Hui-article-box" style="margin-top: 37px;">
	
	<div class="newCrumbs ">订单信息
		</div>
	<div class="">
		<div class="confirm">
			当前订单状态：待发货
		</div>
		<div class="recond-titles">
			<h3>订单信息</h3>
		</div>
		<div class="recond-title" style="margin-top: 30px;">
			<span style="font-size: 16px;">付款时间：{$data['order_list']['order_pay_time']|date="Y-m-d H:i:s",###}</span>
			<span style="margin-left: 300px;font-size: 16px;">租赁周期：{$data.order_list.order_goods_rent_time|date="Y-m-d",###}至{$data.order_list.order_goods_return_time|date="Y-m-d",###}</span>
		</div>
					<table class="table table-border table-bg  table-bordered" style="margin-bottom: 20px;line-height: 30px;">
 						<tr class="text-c">
 							<td style="width: 220px;">产品</td>
 							<td>用户名</td>
 							<td>数量</td>
 							<td>租金</td>
 							<td>押金</td>
 							<td>合计</td>
 							<td>订单状态</td>
  						</tr>
  						<tr style="height: 120px;" class="text-c">
 							<td style="width: 220px;">{$data.order_list.goods_name}</td>
 							<td>{$data.order_list.user_phone}</td>
 							<td>{$data.order_list.goods_amount}</td>
 							<td>￥{$data.order_list.order_total_price-$data.order_list.order_deposit-$data.order_list.order_freight}</td>
 							<td>￥{$data.order_list.order_deposit}</td>
 							<td>￥{$data.order_list.order_total_price}（含运费）</td>
 							<td><span>待发货</span></td>
  						</tr>
					</table>
		<div class="recond-titles">
			<h3>物流信息</h3>
		</div>
		<div class="box">
			<span>收货地址：</span>
			{if condition="$data.order_list.order_express_type eq '3'"}
			<span>{$data.order_list.since_name}</span>
			<span>{$data.order_list.since_tel}</span>
			<span>{$data.order_list.province_name}{$data.order_list.city_name}{$data.order_list.region_name}{$data.order_list.since_detailed_address}</span>
			{else /}
			<span>{$data.order_list.order_receiver_name}</span>
			<span>{$data.order_list.order_mobile}</span>
            <span>{$data.order_list.order_province}{$data.order_list.order_city}{$data.order_list.order_district}{$data.order_list.order_detailed}</span>
            {/if}

			{if condition="$data.order_list.order_express_type eq '1'"}
			<form id="frm" method="post" enctype="multipart/form-data"  class="form-horizontal" action="{:url('order/confirm_add')}">
				<input type="hidden" name="order_id" value="{$order_id}">
				<input id="ipt_company" value="顺丰快递" type="hidden" name="order_deliver_company" >
				<p>物流方式：<span style="margin-left:20px">快递</span></p>
				<span>物流公司</span>：
				 
				 <select id="select_Company" onchange="setCompanyValue()" class="input-text radius size-M"  name="order_deliver_logistics_name"  style="margin-left: 15px;">
				 <option selected="selected" value="shunfeng">顺丰快递</option>
                 <option value="shentong">申通快递</option>
                 <option value="zhongtong">中通快递</option>
                 <option value="yuantong">圆通快递</option>
                 <option value="yunda">韵达快递</option>
                 <option value="gdems">EMS快递</option>
                 <option value="quanfeng">全峰快递</option>
                 <option value="tiantian">天天快递</option>
                 <option value="debang">德邦快递</option>
                 <option value="huitong">百世快递</option>
                 <option value="zhaijisong ">宅急送</option>
				 <option value="auto">其他</option>
				 </select>
				<br>
				<span>运单号：</span><input type="text" name="order_deliver_expressid" class="input-text radius size-M" style="margin-left: 33px;"><br>
				<div class="btn-outerbox">
						<button class="box-btn btn1" type="button" onclick="save()">发货</button>
						<button type="button"  class="box-btn btn2" onclick="returnpage();">返回</button>
				</div>
			</form>
			{else /}
			<form method="post" id="frmzt" enctype="multipart/form-data" style="border:none;" class="form-horizontal" action="{:url('order/confirm_add')}">
				<p>物流方式：<span>{if condition="$data.order_list.order_express_type eq '2'"}上门{else /}自提点{/if}</span></p>
				<input type="hidden" name="order_id" value="{$order_id}">
				<div class="btn-outerbox">
						<button class="box-btn btn1" type="button" onclick="savezt()">发货</button>
						<button type="button"  class="box-btn btn2" onclick="returnpage();">返回</button>
				</div>
			</form>
			{/if}

		</div>
	</div>			
</div>
	

<script>
	$(function(){
	$.Huitab("#tab_demo .tabBar span","#tab_demo .tabCon","current","click","0")});
	var GG = {
        "kk":function(mm){
           var ym=mm;
        }
    }
	 
	$("#page").initPage(71,1,GG.kk);
	$("#page1").initPage(71,1,GG.kk);
	$("#page2").initPage(71,1,GG.kk);
	$("#page3").initPage(71,1,GG.kk);
	$("#page4").initPage(71,1,GG.kk);
	
	function setCompanyValue()
	{
	$("#ipt_company").val($("#select_Company").find("option:selected").text());
	 
	}
function save()
{
     
    
	 if($("input[name='order_deliver_expressid']").val()=="")
	 {
	   layer.msg("运单号不能为空!");
	   return false;
	 }
	$.ajax({
          type: "POST",
          url: "<?php echo url('order/confirm_add', '', false); ?>",
          dataType: 'json',
          cache: false,
          data: $('#frm').serialize(),
          success: function(data) {
            if(data.status == 1) 
            {
			 layer.msg("发货成功!");
			 location.href="{:url('order/index')}?type=2";
			 }else{
              layer.msg(data.msg);
            }

          },
          error: function(xhr, status, error) {
            console.log(xhr);
            console.log(status);
            console.log(error);
          }
        });
	 
}
	function returnpage()
	{
		 location.href="{:url('order/index')}?type=2";
	}
	function savezt()
    {
     
    
	 if($("input[name='order_deliver_expressid']").val()=="")
	 {
	   layer.msg("运单号不能为空!");
	   return false;
	 }
	  
	  
	  $.ajax({
          type: "POST",
          url: "<?php echo url('order/confirm_add', '', false); ?>",
          dataType: 'json',
          cache: false,
          data: $('#frmzt').serialize(),
          success: function(data) {
            if(data.status == 1) 
            {
			 layer.msg("发货成功!");
			 location.href="{:url('order/index')}?type=2";
			 }else{
              layer.msg(data.msg);
            }

          },
          error: function(xhr, status, error) {
            console.log(xhr);
            console.log(status);
            console.log(error);
          }
        });
	 
}
	
	
</script>
 
 
 
 
 
 
 